#!/bin/bash

dbList=("xhc_xds_item" "xhc_xds_goods" "xhc_resource_struct_info" "xhc_resource_descrip" "xhc_interests_resource" "xhc_interests_content" "xhc_intelligent_assistant" "xhc_business_recommend" "xhc_business_link" "xhc_business_info" "xhc_business_app_search" "xhc_assistant_phone" "xhc_assistant_package" "xhc_assistant_other" "xhc_assistant_interest" "xhc_assistant_flow" "xhc_assistant_card" "central_zhongduan_personalized_info" "central_taocan_personalized_info" "central_quanyi_personalized_info" "central_liuliang_personalized_info" "central_haoka_personalized_info" "central_business_library_base" "business_link_temp" "business_general_temp" "content_library_term" "content_library")

for db_name in "${dbList[@]}"
do
  echo "$db_name"
  sed -i "s/from bda_.* where/from bda_$db_name where/" mysql.jmx
  /data/software/apache-jmeter-5.4.3/bin/jmeter -n -t mysql.jmx -l "${db_name}".jtl -f
  sleep 10s
done